home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pull55.zip / PULLSHEL.ZIP / PULLWORK.PAS < prev   
Pascal/Delphi Source File  |  1989-08-24  |  3KB  |  133 lines

  1. { =========================================================================== }
  2. { Pullwork.pas - Work Window procedures for main work area  ver 5.5, 08-24-89 }
  3. {                for PULLSHEL.PAS                                             }
  4. { This file contains all the procedures executed for the Work Window.  These  }
  5. { are the main steps of your program.  With this, you can create a sophisti-  }
  6. { cated multi-level window environment.                                       }
  7. {   Copyright (c) 1987-1989 James H. LeMay, All rights reserved.              }
  8. { =========================================================================== }
  9.  
  10. { R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }         { TP4 directives }
  11. {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}    { TP5 directives }
  12.  
  13. {$define UseDataEntryCode }
  14. { define MultiWorkWndws }
  15.  
  16.  
  17. UNIT PullWork;
  18.  
  19. INTERFACE
  20.  
  21. uses
  22.   Crt,Qwik,Wndw,Pull,PullStat
  23.   {$ifdef UseDataEntryCode }
  24.   ,PullData;
  25.   {$else }
  26.   ;
  27.   {$endif }
  28.  
  29. procedure WorkWndw;
  30.  
  31.  
  32. IMPLEMENTATION
  33.  
  34. { ========================= Work Window Steps =============================== }
  35. { This procedure will have all the procedures for the Work window(s).         }
  36. { Each step assumes that some keystroke has been pressed and returns a value  }
  37. { for Key and ExtKey and any necessary change to WorkWndwStep.                }
  38. { --------------------------------------------------------------------------- }
  39. var
  40.   Start1: word;
  41.  
  42. {$ifdef MultiWorkWndws }
  43. procedure ResetWorkWndwStep;
  44. begin
  45.   case TWS.WSname of
  46.     Window1:  WorkWndwStep := 1;
  47.     Window2:  WorkWndwStep := 3;
  48.   end;
  49. end;
  50.  
  51. procedure HideWorkWndw;
  52. begin
  53.   HideWindow;
  54.   TopWorkWndwName := TWS.WSname;
  55.   ResetWorkWndwStep;
  56. end;
  57.  
  58. procedure AccessWorkWndw (WN: WindowNames);
  59. begin
  60.   if WN<>TWS.WSname then
  61.     begin
  62.       { -- if accessing a PermMode window, hide all upper windows. -- }
  63.       if (GetLevelIndex(WN)<=PLI) then
  64.         while (LI>PLI) do
  65.           HideWindow;         { Use RemoveWindow for serial access }
  66.       AccessWindow (WN);
  67.       ResetWorkWndwStep;
  68.     end;
  69. end;
  70. {$endif }
  71.  
  72. {$F+}
  73. procedure KbdIdle;
  74. begin
  75.   { Nothing to include this time, but fill in what you want to do while }
  76.   { the keyboard is idle. }
  77. end;
  78. {$F-}
  79.  
  80. procedure ShowFields;
  81. begin
  82.   WWrite ( 2, 2,'Integer:');
  83.   DisplayFields (ord(aIntegerDE),ord(aIntegerDE));
  84. end;
  85. {
  86. procedure MakeWorkWndw2;
  87. begin
  88.   SetWindowModes (HiddenMode);
  89.   MakeWindow ( 8,21,10,40,LightBlue+LightGrayBG,LightBlue+LightGrayBG,
  90.                DoubleBrdr,Window2);
  91.   SetWindowModes (0);
  92.   WriteToHidden (Window2);
  93.   TitleWindow (Top   ,Left  ,SameAttr,'2');
  94.   TitleWindow (Top   ,Center,SameAttr,' Work Window 2 ');
  95.   TitleWindow (Bottom,Center,SameAttr,' Press ESC to Hide ');
  96.   WWriteC (1,'Type in any input');
  97.   WGotoRC (2,1);
  98.   WriteToCRT;
  99. end;
  100. }
  101. procedure EditFields;
  102. begin
  103.   EnterSeq (ord(aIntegerDE),ord(aIntegerDE),Start1);
  104. end;
  105.  
  106. procedure InitWorkWndws;
  107. begin
  108.   ShowFields;
  109.   WorkWndwStep := 1;
  110.   Key := NullKey;  { #00 }
  111. end;
  112.  
  113. procedure WorkWndw;
  114. begin
  115.   {$ifdef MultiWorkWndws }
  116.   AccessWorkWndw (TopWorkWndwName);
  117.   {$endif }
  118.   case WorkWndwStep of
  119.     0:  InitWorkWndws;
  120.     1:  EditFields;
  121.   end;
  122. end;
  123.  
  124. BEGIN
  125.   WorkWndwStep := 0;          { Initial step for work windows. }
  126.   {$ifdef MultiWorkWndws }
  127.   TopWorkWndwName := Window1;
  128.   {$endif }
  129.   Start1 := ord(aIntegerDE);
  130.   AddrWorkWndw := @WorkWndw;
  131.   AddrKbdIdle  := @KbdIdle;
  132. END.
  133.